const Tool = {
  // handle users
  handleUser: users => {
    if (users) {
      return users.map((obj, index) => {
        const userObj = {}
        userObj.id = obj.id
        userObj['用户名'] = obj.username
        userObj['昵称'] = obj.name
        userObj['邮箱'] = obj.email
        userObj['角色'] = obj.nickname
        userObj['性别'] = obj.sex === 1 ? '男' : obj.sex === 0 ? '女' : '未知'
        userObj['地址'] = obj.addr
        return userObj
      })
    }
  },
  toLower: text => {
    return text.toString().toLowerCase()
  }
}

export default Tool
